NAME=NtService

all=$(NAME).exe

# define objects
objs=Service.obj NtService.obj main.obj

# define complier name and link name
CC=cl
LINK=link

# define complier FLAGS
C_FLAGS = /c /W4 /D "UNICODE" /nologo

# define LINK FLAGS
LINK_FLAGS = /SUBSYSTEM:CONSOLE /MACHINE:x86 /out:$(NAME).exe /INCREMENTAL /NOLOGO
LINK_LIBS = Advapi32.lib

#Link the objects to executable file
$(NAME).exe : $(objs)
  $(LINK) $(LINK_FLAGS) $(LINK_LIBS) $(objs)

main.obj:
  $(CC) $(C_FLAGS) main.cpp

Service.obj:
  $(CC) $(C_FLAGS) Service.cpp

NTService.obj:
  $(CC) $(C_FLAGS) NtService.cpp

clean:
    del *.obj *.exe *.ilk *.pdb